package com.fit.entities;

import java.io.Serializable;

import javax.persistence.Embeddable;
import javax.persistence.ManyToOne;

@Embeddable
public class OfferItemPk implements Serializable {

	@ManyToOne
	private TransportOffer transportOffer;
	@ManyToOne
	private DestinationOffer destinationOffer;
	@ManyToOne
	private Arrangement arrangement;

	public TransportOffer getTransportOffer() {
		return transportOffer;
	}

	public void setTransportOffer(TransportOffer transportOffer) {
		this.transportOffer = transportOffer;
	}

	public DestinationOffer getDestinationOffer() {
		return destinationOffer;
	}

	public void setDestinationOffer(DestinationOffer destinationOffer) {
		this.destinationOffer = destinationOffer;
	}

	public Arrangement getArrangement() {
		return arrangement;
	}

	public void setArrangement(Arrangement arrangement) {
		this.arrangement = arrangement;
	}

	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (o == null || getClass() != o.getClass())
			return false;

		OfferItemPk that = (OfferItemPk) o;

		if (transportOffer != null ? !transportOffer
				.equals(that.transportOffer) : that.transportOffer != null)
			return false;
		if (destinationOffer != null ? !destinationOffer
				.equals(that.destinationOffer) : that.destinationOffer != null)
			return false;
		if (arrangement != null ? !arrangement.equals(that.arrangement)
				: that.arrangement != null)
			return false;

		return true;
	}

}
